perm filename REVIEW[LSP,JRA]1 blob sn#108268 filedate 1974-06-21 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	REYNOLDS  H-O
C00006 ENDMK
C⊗;
REYNOLDS  H-O

Classification of interpreters
1.higher order functions≡functionals
2. order of evaluation

features of lang
1. applicative
2. imperative

for interpreters; two languages
1.defined language
2. defining language

sim app lang
introduce binding and environmeets and evaluation
introduce extension of environment--obvious

constants, variables; application expression-operator-operands
evaluation const and var
	r1(r1 r2 ...rn)  eval ALL IN SAME envir., giving f a1 a2 ...an
	 if f is not funct. LOSE; o.w. apply f to args

notes:
1.functionn is capable of being applied
2.appliaction may not terminate; sim for eval
3in pure applicative, no side-effects
4. call-by-value
5. order of evaluation of args not given. in pure applic only
involves question of termination since no s-e.
assumes left to right.

now lambdas: the evaluation of a lambda expression of n formals ALWAYS
terminates and produces a  FUNCTION of n args.---closure.
 example λx.x+y produces different functions when evaluated in environ
when y=1, y=0, y= -1

compare c-b-v and c-b-n: consider r0(r1 ...rn) in ea.
ass vaule of r0 is func f originally closed in eλ: λ(x1 ..xn)rλ
c-b-v eval r0 ...rn in ea.   eval rλ in extension of eλ containing xi-ai's.
c-b-n  each occurrence of ri is evaled when actually used.

introduce conditionals-standard

introdce let expressions and recursive let
  question: let seems unnecessary; rec let is necessary.


how to introduce basic ops
1.constants denoting basic functions
2. predefine variables. specified by introducing initial environ.
3.special expressions whose eval. will perform basic ops

question what the hell does 1 and 3 mean?


on to defined language: singla arg, c-b-v,simple conds, only recursive let,
values are int, booles or functs. only basics will be suc and equal.

the defining language:use abstract syntax (only for structures no seqs)
structure defintion called record equations; generate predicate and constructors
from selector part of structure automat(by convention).
three forms of abstract syntax equation
1. as above: record equation
2.union equation--bnf alternatives
3.function equation
quest:1-2 direct trans of bnf. what about 3?